<?php

namespace Fize\Think\Develop;

use PHPUnit\Framework\TestCase as Common;
use think\App;

/**
 * 单元测试
 */
abstract class TestCase extends Common
{

    /**
     * @var App 应用
     */
    protected static $app;

    /**
     * @var string 命名空间
     */
    protected static $namespace;

    /**
     * @var string 基准URL
     */
    protected static $baseUrl = '';

    use ApplicationTrait;
    use AssertionsTrait;
    use CrawlerTrait;

    protected function setUp(): void
    {
        $root_path = dirname(__DIR__, 5) . DIRECTORY_SEPARATOR;
        self::$app = new APP($root_path);
        if (self::$namespace) {
            self::$app->setNamespace(self::$namespace);
        }
        self::$app->initialize();
    }

}
